function GM:EntityTakeDamage( ent, inflictor, attacker, amount )

	if(string.find(ent:GetClass(), "barrier_") == 1 || ent:GetClass() == "prop_physics") then
		if ent.aHealth then
			ent.aHealth = ent.aHealth - amount
		else
			ent.aHealth = 1000
		end
	
		if(ent:GetVar("IsPly", "nothing") != nil) then return end // The death is already handled.

		if(ent.aHealth <= 0) then
			local vPoint = ent:GetPos(self)
			local effectdata = EffectData()
			effectdata:SetStart( vPoint )
			effectdata:SetOrigin( vPoint )
			effectdata:SetScale( 2 )
			util.Effect( "Explosion", effectdata )
			ent.Remove(ent)
		end
	else
		// This isn't an entity that should be damaged.
	end
end
